/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ConfirmacionConexion.java
 *
 * Created on 25-ago-2012, 15:58:30
 */
package Presentacion;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;

/**
 * Clase que muestra la confirmación de la conexión al servidor que extiende de javax.swing.JFrame
 * @author jero
 */
public class ConfirmacionConexion extends javax.swing.JFrame {

    InterfaceRemota rmiServer;
    
    /**
     * Constructor de la clase
     */
    public ConfirmacionConexion() {
        this.getContentPane().setBackground(Color.BLACK);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = this.getSize();
        frameSize.height = ((frameSize.height > screenSize.height) ? screenSize.height : frameSize.height);
        frameSize.width = ((frameSize.width > screenSize.width) ? screenSize.width : frameSize.width);
        this.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); 
        
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        Continuar = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Conexión Exitosa");
        setBackground(new java.awt.Color(255, 255, 255));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        getContentPane().setLayout(null);

        jLabel1.setFont(new java.awt.Font("Simplified Arabic", 1, 14)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("CONEXIÓN EXITOSA");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(61, 26, 126, 24);

        Continuar.setText("Continuar");
        Continuar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ContinuarActionPerformed(evt);
            }
        });
        getContentPane().add(Continuar);
        Continuar.setBounds(80, 140, 79, 23);
        getContentPane().add(jLabel2);
        jLabel2.setBounds(72, 74, 0, 0);
        getContentPane().add(jLabel3);
        jLabel3.setBounds(82, 68, 0, 0);

        jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Imagenes\\logo2.gif")); // NOI18N
        getContentPane().add(jLabel4);
        jLabel4.setBounds(70, 60, 130, 60);

        pack();
    }// </editor-fold>//GEN-END:initComponents
/**
 * Asigna la acción de crear un nuevo atributo de la clase [@Registro] a un boton, 
 * asignándole un atributo de tipo InterfaceRemota
 * @param evt 
 */
private void ContinuarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ContinuarActionPerformed
   // TODO add your handling code here:
    Registro registro = new Registro();
    registro.setVisible(true);
    registro.getInterfaceRemota(rmiServer);
    this.setVisible(false);
    
    
}//GEN-LAST:event_ContinuarActionPerformed

    /**
     * Asigna el valor recibido por parámetro al atributo InterfaceRemota rmiServer
     * @param args the command line arguments
     */

public void getInterfaceRemota(InterfaceRemota ir){
   
    rmiServer = ir;

}
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Continuar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    // End of variables declaration//GEN-END:variables
}

